package controller;

import java.io.IOException;
import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;


@ManagedBean
@ViewScoped
public class MenuBean implements Serializable{

	private static final long serialVersionUID = 1L;

	public MenuBean(){
		
	}
	
	public void materias(ActionEvent actionEvent){
		String materia = FacesContext.getCurrentInstance().getExternalContext()
		.getRequestParameterMap().get("materia");
		FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().put("materia", materia);  
		try {
			FacesContext.getCurrentInstance().getExternalContext().redirect("materias.jsf");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void notas(ActionEvent actionEvent){
		String materia = FacesContext.getCurrentInstance().getExternalContext()
		.getRequestParameterMap().get("materia");
		FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().put("materia", materia);  
		try {
			FacesContext.getCurrentInstance().getExternalContext().redirect("notas.jsf");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}
	
